import type { RouteRecordRaw } from 'vue-router';

export const staticRoutes: Array<RouteRecordRaw> = [
  // 首页
  {
    path: '/home',
    name: 'home',
    component: () => import('@/views/home/index.vue'),
    meta: {
      hidden: true
    }
  },
  // 排行榜
  {
    path: '/top',
    name: 'top',
    component: () => import('@/views/top/index.vue'),
    meta: {
      hidden: true
    }
  },
  // 分类
  {
    path: '/sort',
    name: 'sort',
    component: () => import('@/views/sort/index.vue'),
    meta: {
      hidden: true
    }
  },
  // 听单
  {
    path: '/listening',
    name: 'listening',
    component: () => import('@/views/listening/index.vue'),
    meta: {
      hidden: true
    }
  },
  // 搜索
  {
    path: '/search',
    name: 'search',
    component: () => import('@/views/search/index.vue'),
    meta: {
      hidden: true
    }
  },
  // 分类详情
  {
    path: '/details',
    name: 'details',
    component: () => import('@/views/details/index.vue'),
    meta: {
      hidden: true
    }
  },
  // 搜索列表
  {
    path: '/searchlist',
    name: 'searchlist',
    component: () => import('@/views/searchlist/index.vue'),
    meta: {
      hidden: true
    }
  },
  // 播放列表
  {
    path: '/playlist',
    name: 'playlist',
    component: () => import('@/views/playlist/index.vue'),
    meta: {
      hidden: true
    }
  },
  {
    path: '/',
    redirect: '/home'
  }
];

/**
 * 任意路由: 匹配任意的路由 必须最后注册
 */
export const anyRoute: RouteRecordRaw = {
  path: '/:pathMatch(.*)',
  name: 'Any',
  redirect: '/404',
  meta: {
    hidden: true
  }
};